<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>月份判断</title>
</head>
<body>
    <script>
        var month = 6;

        switch(month){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                console.log(month+'月有'+31+'天');
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                console.log(month+'月有'+30+'天');
                break;
            case 2:
                console.log(month+'月有'+28+'天'+'或者'+29+'天');
        }

        // 修改输出说明
    </script>
</body>
</html>